package entities;
/* MPL License text (see http://www.mozilla.org/MPL/) */


import java.util.ArrayList;
import javax.faces.model.SelectItem;

/**
 * <p>The SelectionTagsBean Class is the backing bean for the selection
 * components demonstration. It is used to store the options and selected values
 * of the various selection components.</p>
 * <p>For Developers new to JSF, the SelectItem object is a key class for
 * working with ICEfaces standard enhanced components. It can be added
 * as the &lt;f:selectItems /&gt; tags value attribute to generate  list data.
 * JSF takes care of the default value and value binding in general.</p>
 * <p>Two gotcha when using and of the selection tags with JSF 1.1.
 * <li>use boolean primative instead of the Boolean Object</li>
 * <li>selection tags require String object.  If you want to use another
 * object type for list use a Converter.</li>
 * </p>
 *
 * @sinse 0.3.0
 */
public class CountryBean {

    /**
     * Gets the option items for countries.
     *
     * @return array of country items
     */
    public SelectItem[] getCountryItems() {
        ArrayList<String> countryList = new ArrayList();
        
        countryList.add("Albania");
        countryList.add("Argentina");
        countryList.add("Australia");
        countryList.add("Austria");
        countryList.add("Belarus");
        countryList.add("Belgium");
        countryList.add("Bosnia Herzegovina");
        countryList.add("Brazil");
        countryList.add("Bulgaria");
        countryList.add("Chile");
        countryList.add("Croatia");
        countryList.add("Cyprus");
        countryList.add("Czech Republic");
        countryList.add("Denmark");
        countryList.add("Ecuador");
        countryList.add("Estonia");
        countryList.add("Finland");
        countryList.add("France");
        countryList.add("Georgia");
        countryList.add("Germany");
        countryList.add("Greece");
        countryList.add("Hungary");
        countryList.add("Iceland");
        countryList.add("India");
        countryList.add("Ireland {Republic}");
        countryList.add("Israel");
        countryList.add("Italy");
        countryList.add("Japan");
        countryList.add("Kazakhstan");
        countryList.add("Korea South");
        countryList.add("Latvia");
        countryList.add("Liechtenstein");
        countryList.add("Lithuania");
        countryList.add("Luxembourg");
        countryList.add("Macedonia");
        countryList.add("Malta");
        countryList.add("Mexico");
        countryList.add("Moldova");
        countryList.add("Monaco");
        countryList.add("Montenegro");
        countryList.add("Netherlands");
        countryList.add("New Zealand");
        countryList.add("Norway");
        countryList.add("Poland");
        countryList.add("Portugal");
        countryList.add("Romania");
        countryList.add("Russian Federation");
        countryList.add("San Marino");
        countryList.add("Serbia");
        countryList.add("Slovakia");
        countryList.add("Slovenia");
        countryList.add("Spain");
        countryList.add("Sweden");
        countryList.add("Switzerland");
        countryList.add("Turkey");
        countryList.add("Ukraine");
        countryList.add("United Kingdom");
        countryList.add("United States");
        countryList.add("Uruguay");

        SelectItem[] countryItems = new SelectItem[countryList.size()];
        for (int i = 0; i < countryList.size(); i++) {
            countryItems[i] = new SelectItem(countryList.get(i));
        }
        return countryItems;
    }
}
